﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<link href="<%=request.getContextPath()%>/css/common.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>
<script>
	//此处为表单验证部分，请同学们课下自己完善
</script>
</head>
<body>
	<form  action="<%=request.getContextPath()%>/news/save" method="post" >
		<table width="100%" border="0" cellspacing="5" cellpadding="0">
			<thead>
				<tr>
					<td align="center" colspan="2" class="text_tabledetail2">增加新闻</td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td style="text-align:right;" class="text_tabledetail2">分类</td>
					<td style="text-align:left;">
						<!-- 列出所有的新闻分类 --> <select name="categoryId">
							<c:forEach items="${categorys }" var="c">
								<option value="${c.id }">${c.name }</option>
							</c:forEach>
					</select>
					</td>
				</tr>
				<tr>
					<td style="text-align:right;" class="text_tabledetail2">标题</td>
					<td style="text-align:left;"><input type="text" name="title"
						value="" /></td>
				</tr>
				<tr>
					<td style="text-align:right;" class="text_tabledetail2">作者</td>
					<td style="text-align:left;"><input type="text" name="author"
						value="" /></td>
				</tr>

				<tr>
					<td style="text-align:right;" class="text_tabledetail2">摘要</td>
					<td style="text-align:left;"><textarea id="summary"
							name="summary" rows="8" cols="50"></textarea></td>
				</tr>
				<tr>
					<td class="text_tabledetail2">内容</td>
					<td>
						<div id="xToolbar"></div> <textarea id="newscontent"
							name="content" class="ckeditor" rows="8"></textarea>
					</td>
				</tr>


				<tr>
					<td style="text-align:right;" class="text_tabledetail2">上传图片</td>
					<td style="text-align:left;"><input type="file" name="picPath"
						value="" /></td>
				</tr>
				<tr>
					<td style="text-align:center;" colspan="2">
						<button type="submit" class="page-btn" name="save">保存</button>
						<button type="button" class="page-btn" name="return"
							onclick="javascript:location.href='newsDetailList.jsp'">返回</button>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
</body>
</html>